{include file="layout/layout" /}
<body style="background-color: rgb(255, 255, 255); overflow: auto; cursor: default; -moz-user-select: inherit;">
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
    <div class="fixed-bar">
        <div class="item-title">
            <div class="subject">
                <h3>商户管理</h3>
                <h5>网站系统商户索引与管理</h5>
            </div>
        </div>
    </div>
    <!-- 操作说明 -->
    <div id="explanation" class="explanation" style="color: rgb(44, 188, 163); background-color: rgb(237, 251, 248); width: 100%; height: 100%;">
        <div id="checkZoom" class="title"><i class="fa fa-lightbulb-o"></i>
            <h4 title="提示相关设置操作时应注意的要点">操作提示</h4>
            <span title="收起提示" id="explanationZoom" style="display: block;"></span>
        </div>
        <ul>
            <li>会员列表管理, 可以给会员群发信息、邮件等.</li>
            <li>分销系统可以查看会员上下级信息.</li>
        </ul>
    </div>
    <div class="flexigrid">
        <div class="mDiv">
            <div class="ftitle">
                <h3>商户列表</h3>
                <h5>(共<span id="user_count">{$count}</span>条记录)</h5>
            </div>
            <div title="刷新数据" class="pReload"><i class="fa fa-refresh"></i></div>
                <!--搜索-->
                <div class="sDiv">
                	<form action="" method='post'>
                    <div class="sDiv2">
                        <select name="agent_id" style='width:130px'>
                            <option value="">请选择代理商</option>
                            {foreach $agents as $v}
                                <option value="{$v.agem_id}" {if isset($param.agent_id) && ($param.agent_id==$v.agem_id)}selected{/if}>{$v.agem_principals}</option>
                            {/foreach}
                        </select>
                    </div>
                    <div class="sDiv2">
                        <select name="cate_id" style='width:130px'>
                            <option value="0">请选择商户分类</option>
                            {foreach $cates as $v}
                                <option value="{$v.ty_id}" {if isset($param.cate_id) && ($param.cate_id==$v.ty_id)}selected{/if}>{$v.ty_name}</option>
                            {/foreach}
                        </select>
                    </div>
                    <div class="sDiv2">
                        <input type="text" name='name' {if isset($param.name)}value="{$param.name}"{/if} id="search_key" size="30" class="qsbox" placeholder="请输入商户名称">
                    </div>
                    <div class="sDiv2">
                        <input type="text" name='mobile' {if isset($param.mobile)}value="{$param.mobile}"{/if} id="search_key" size="30" class="qsbox" placeholder="请输入手机号">
                        <input type="submit" class="btn" value="搜索">
                    </div>
                	</form>
                </div>
        </div>
        <div class="hDiv">
            <div class="hDivBox">
                <table cellspacing="0" cellpadding="0">
                    <thead>
                    <tr>
                        <th class="sign" axis="col0">
                            <div style="width: 24px;"><i class="ico-check"></i></div>
                        </th>
                        <th align="left" abbr="user_id" axis="col3" class="">
                            <div style="text-align: center; width: 40px;" class="">商户ID</div>
                        </th>
                        <th align="left" abbr="nickname" axis="col4" class="">
                            <div style="text-align: center; width: 100px;" class="">商户名称</div>
                        </th>
                        <th align="center" abbr="level" axis="col5" class="">
                            <div style="text-align: center; width: 80px;" class="">手机号</div>
                        </th>
                        <th align="center" abbr="level" axis="col5" class="">
                            <div style="text-align: center; width: 80px;" class="">登录账号</div>
                        </th>
                        <th align="center" abbr="total_amount" axis="col6" class="">
                            <div style="text-align: center; width: 60px;" class="">店主姓名</div>
                        </th>
                        <th align="center" abbr="email" axis="col6" class="">
                            <div style="text-align: center; width: 80px;" class="">店铺电话</div>
                        </th>
                        <th align="center" axis="col6" class="">
                            <div style="text-align: center; width: 180px;" class="">区域</div>
                        </th>
                        <th align="center" axis="col6" class="">
                            <div style="text-align: center; width: 60px;" class="">商户分类</div>
                        </th>
                        <th align="center" axis="col6" class="">
                            <div style="text-align: center; width: 50px;" class="">代理商</div>
                        </th>
                        <th align="center" axis="col6" class="">
                            <div style="text-align: center; width: 50px;" class="">状态</div>
                        </th>
                        <th align="center" abbr="mobile" axis="col6" class="">
                            <div style="text-align: center; width: 60px;" class="">APPID</div>
                        </th>
                        <th align="center" abbr="user_money" axis="col6" class="">
                            <div style="text-align: center; width: 60px;" class="">OpenID</div>
                        </th>
                        <th align="center" abbr="pay_points" axis="col6" class="">
                            <div style="text-align: center; width: 120px;" class="">最近登录时间</div>
                        </th>
                        <th align="center" abbr="reg_time" axis="col6" class="">
                            <div style="text-align: center; width: 120px;" class="">注册日期</div>
                        </th>
                        <th align="center" axis="col1" class="handle">
                            <div style="text-align: center; width: 250px;">操作</div>
                        </th>
                    </tr>
                    </thead>
                </table>
            </div>
        </div>
        <div class="tDiv">
            <div class="tDiv2">
            <div class="fbutton">
                <div title="导出商户" class="add">
                <a href="?act=ep" style="color:#0ba4da;"><span><i class="fa fa-share"></i>导出商户</span></a>
                </div>
            </div>
            </div>
            <div style="clear:both"></div>
        </div>
         <div class="bDiv" style="height: auto;" id="ajax_return"><div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
    <table>
        <tbody>
        	{foreach $shop_list as $k=>$v}
            <tr data-id="2592" id="del{$v.sp_id}">
                <td class="sign">
                    <div style="width: 24px;"><i class="ico-check"></i></div>
                </td>
                <td class="" align="left">
                    <div style="text-align: center; width: 40px;">{$v.sp_id}</div>
                </td>
                <td class="" align="left">
                    <div style="text-align: center; width: 100px;">{$v.sp_name}</div>
                </td>
                <td class="" align="left">
                    <div style="text-align: center; width: 80px;">{$v.sp_mobile}</div>
                </td>
                <td class="" align="left">
                    <div style="text-align: center; width: 80px;">{$v.sp_username}</div>
                </td>
                <td class="" align="left">
                    <div style="text-align: center; width: 60px;">{$v.sp_true_name}</div>
                </td>
                <td class="" align="left">
                    <div style="text-align: center; width: 80px;">{$v.sp_phone}</div>
                </td>
                <td class="" align="left">
                    <div style="text-align: center; width: 180px;">{$v.merger_name}</div>
                </td>
                <td class="" align="left">
                    <div style="text-align: center; width: 60px;">{$v.ty_name}</div>
                </td>
                <td class="" align="left">
                    <div style="text-align: center; width: 50px;">{$v.agem_principals}</div>
                </td>
                <td class="" align="left">
                    <div style="text-align: center; width: 50px;">{$v.sp_status}</div>
                </td>
                <td class="" align="left">
                    <div style="text-align: center; width: 60px;">{$v.sp_appid}</div>
                </td>
                <td class="" align="left">
                    <div style="text-align: center; width: 60px;">{$v.sp_openid}</div>
                </td>
                <td class="" align="left">
                    <div style="text-align: center; width: 120px;">{$v.sp_login_time}</div>
                </td>
                <td class="" align="left">
                    <div style="text-align: center; width: 120px;">{$v.sp_create_time}</div>
                </td>
                <td class="handle" align="center">
                    <div style="text-align: center; width: 150px; max-width:250px;">
                        <a class="btn blue" href="shopDetail?id={$v.sp_id}"><i class="fa fa-search"></i>详情</a>
                        <!-- <a class="btn blue" href="shopUpd?id={$v.sp_id}"><i class="fa fa-pencil-square-o"></i>编辑</a> -->
                        <a class="btn blue" href={:url('goods/goodsList',['shop_id'=>$v.sp_id])}><i class="fa fa-search"></i>查看商品</a>
                        <a class="btn red" href="javascript:void(0)" data-id="2592" onclick="del({$v.sp_id})"><i class="fa fa-trash-o"></i>删除</a>
                    </div>
                </td>
            </tr>    
            {/foreach}
        </tbody>
    </table>
</div>
<!--分页位置-->
<center>{$page|raw}</center>
</div>
        <br>
        <br>
        <br>
<script>
	function del(id){
		var id = id;
		$.get("shopDel",{'id':id},function(status){
			if(status == 1){
				$('#del'+id).remove();
				alert('删除成功！');
			}else{
				alert('删除失败！');
			}
		})
	}
</script>
</body>
</html>